<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 vector-feature-night-mode-enabled skin-theme-clientpref-os vector-sticky-header-enabled" lang="fr" dir="ltr"><head>
<meta charset="UTF-8">
<title>MATLAB</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://fr.wikipedia.org/wiki/MATLAB"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-MATLAB rootpage-MATLAB skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">MATLAB</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr">
<div class="infobox_v3 infobox infobox--frwiki noarchive" style="width:260px">
<div class="entete icon informatique" style="color: #000000;"><style data-mw-deduplicate="TemplateStyles:r228712691">
/* start https://fr.wikipedia.org/ */
.mw-parser-output .entete.informatique{background-image:url("./_mw_/Picto.nfo.png")}
/* end https://fr.wikipedia.org/ */
</style>
<div>MATLAB</div>
</div>
<div class="images">
</div>
<div class="hr" style="height:2px;"></div>
<div class="images">
</div>
<table><caption style="color:#000000;">Informations</caption>
<tbody><tr>
<th scope="row">Créateur</th>
<td>
<a href="Cleve_Moler" title="Cleve Moler">Cleve Moler</a></td>
</tr>
<tr>
<th scope="row"><a href="D%C3%A9veloppeur" title="Développeur">Développé par</a></th>
<td>
<a href="The_MathWorks" title="The MathWorks">MathWorks</a></td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Première version</a>
</th>
<td>
<span class="wd_p571"><time>1984</time></span></td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Dernière version</a>
</th>
<td>
<span class="wd_p348">R2025b (<time class="nowrap" datetime="2025-09-17" data-sort-value="2025-09-17">17 septembre 2025</time>)<sup id="cite_ref-wikidata-d2101fd1416246a9233dcd29e3deb706f0668d14_1-0" class="reference"><a href="#cite_note-wikidata-d2101fd1416246a9233dcd29e3deb706f0668d14-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></span></td>
</tr>
<tr>
<th scope="row"> <a href="Langage_de_programmation" title="Langage de programmation">Écrit en</a>
</th>
<td>
<span class="wd_p277"><a href="C_(langage)" title="C (langage)">C</a>, <a href="C%2B%2B" title="C++">C++</a>, <a href="Fortran" title="Fortran">Fortran</a> et <a href="Java_(langage)" title="Java (langage)">Java</a></span></td>
</tr>
<tr>
<th scope="row"><a href="Syst%C3%A8me_d'exploitation" title="Système d'exploitation">Système d'exploitation</a></th>
<td>
<span class="wd_p306"><a href="Microsoft_Windows" title="Microsoft Windows">Microsoft Windows</a>, <a href="MacOS" title="MacOS">macOS</a> et <a href="Linux" title="Linux">Linux</a></span></td>
</tr>
<tr>
<th scope="row"><a href="Plateforme_informatique" title="Plateforme informatique">Environnement</a></th>
<td>
<a href="Linux" title="Linux">Linux</a>, <a href="Unix" title="Unix">Unix</a>, <a href="Mac_OS" class="mw-redirect" title="Mac OS">Mac OS</a>, <a href="Microsoft_Windows" title="Microsoft Windows">Windows</a></td>
</tr>
<tr>
<th scope="row"><a href="Format_de_donn%C3%A9es" title="Format de données">Formats</a> lus</th>
<td>
<span class="wd_p1072">MATLAB M-File <small>(<a href="https://www.wikidata.org/wiki/Q15938816" class="extiw external" title="d:Q15938816"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, <a href="Hierarchical_Data_Format" title="Hierarchical Data Format">Hierarchical Data Format</a>, MAT-file <small>(<a href="https://www.wikidata.org/wiki/Q28770627" class="extiw external" title="d:Q28770627"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MAT4 <small>(<a href="https://www.wikidata.org/wiki/Q28771107" class="extiw external" title="d:Q28771107"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MAT-file, Level 5, version 6 <small>(<a href="https://www.wikidata.org/wiki/Q28770728" class="extiw external" title="d:Q28770728"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MAT-file, Level 5, version 7 <small>(<a href="https://www.wikidata.org/wiki/Q28771220" class="extiw external" title="d:Q28771220"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MAT-file, Level 5, version 7.3 <small>(<a href="https://www.wikidata.org/wiki/Q28771221" class="extiw external" title="d:Q28771221"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB Simulink model Template <small>(<a href="https://www.wikidata.org/wiki/Q105852739" class="extiw external" title="d:Q105852739"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB license passcode <small>(<a href="https://www.wikidata.org/wiki/Q105861394" class="extiw external" title="d:Q105861394"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB Mac 64bit compiled function <small>(<a href="https://www.wikidata.org/wiki/Q105861951" class="extiw external" title="d:Q105861951"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB Linux 64bit compiled function <small>(<a href="https://www.wikidata.org/wiki/Q105861997" class="extiw external" title="d:Q105861997"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB support package <small>(<a href="https://www.wikidata.org/wiki/Q105862193" class="extiw external" title="d:Q105862193"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB app installer <small>(<a href="https://www.wikidata.org/wiki/Q105864044" class="extiw external" title="d:Q105864044"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB Compiler Project <small>(<a href="https://www.wikidata.org/wiki/Q105864513" class="extiw external" title="d:Q105864513"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, Live Code File Format <small>(<a href="https://www.wikidata.org/wiki/Q113046211" class="extiw external" title="d:Q113046211"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small> et Light Sheet Microscope <small>(<a href="https://www.wikidata.org/wiki/Q28206508" class="extiw external" title="d:Q28206508"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small></span></td>
</tr>
<tr>
<th scope="row"><a href="Format_de_donn%C3%A9es" title="Format de données">Formats</a> écrits</th>
<td>
<span class="wd_p1073">MATLAB M-File <small>(<a href="https://www.wikidata.org/wiki/Q15938816" class="extiw external" title="d:Q15938816"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, <a href="Hierarchical_Data_Format" title="Hierarchical Data Format">Hierarchical Data Format</a>, MATLAB Simulink model Template <small>(<a href="https://www.wikidata.org/wiki/Q105852739" class="extiw external" title="d:Q105852739"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB Mac 64bit compiled function <small>(<a href="https://www.wikidata.org/wiki/Q105861951" class="extiw external" title="d:Q105861951"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB Linux 64bit compiled function <small>(<a href="https://www.wikidata.org/wiki/Q105861997" class="extiw external" title="d:Q105861997"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB support package <small>(<a href="https://www.wikidata.org/wiki/Q105862193" class="extiw external" title="d:Q105862193"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB app installer <small>(<a href="https://www.wikidata.org/wiki/Q105864044" class="extiw external" title="d:Q105864044"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small>, MATLAB Compiler Project <small>(<a href="https://www.wikidata.org/wiki/Q105864513" class="extiw external" title="d:Q105864513"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small> et Live Code File Format <small>(<a href="https://www.wikidata.org/wiki/Q113046211" class="extiw external" title="d:Q113046211"><span class="indicateur-langue" title="Voir l'élément Wikidata correspondant">d</span></a>)</small></span></td>
</tr>
<tr>
<th scope="row"> Type
</th>
<td>
<a href="Calcul_num%C3%A9rique" title="Calcul numérique">Calcul numérique</a></td>
</tr>
<tr>
<th scope="row"><a href="Licence_de_logiciel" title="Licence de logiciel">Licence</a></th>
<td>
<a href="Logiciel_propri%C3%A9taire" title="Logiciel propriétaire">Propriétaire</a></td>
</tr>
<tr>
<th scope="row"><a href="Site_web" title="Site web">Site web</a></th>
<td>
<a rel="nofollow" class="external text" href="https://fr.mathworks.com/">fr.mathworks.com</a></td>
</tr>
</tbody></table>
<p class="mw-empty-elt">
</p>
</div>
<p><b>MATLAB</b> (ou <b>Matlab</b>) est un <a href="Langage_de_script" title="Langage de script">langage de script</a><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> destiné au <a href="Calcul_num%C3%A9rique" title="Calcul numérique">calcul numérique</a>, et émulé par l'<a href="Environnement_de_d%C3%A9veloppement" title="Environnement de développement">environnement de développement</a> du même nom. Le nom MATLAB est un <a href="Mot-valise" title="Mot-valise">mot-valise</a> construit sur l'<a href="Anglais" title="Anglais">anglais</a> <i><span class="lang-en" lang="en"><u>mat</u>rix <u>lab</u>oratory</span></i> (« <a href="Laboratoire_de_recherche" title="Laboratoire de recherche">laboratoire</a> <a href="Matrice_(math%C3%A9matiques)" title="Matrice (mathématiques)">matriciel</a> »).
</p><p>Développé par la société <a href="The_MathWorks" title="The MathWorks">The MathWorks</a>, MATLAB permet de manipuler des <a href="Matrice_(math%C3%A9matiques)" title="Matrice (mathématiques)">matrices</a>, d'afficher des <a href="Courbe" title="Courbe">courbes</a> et des données, de mettre en œuvre des <a href="Algorithme" title="Algorithme">algorithmes</a>, de créer des <a href="Interactions_humain-machine" title="Interactions humain-machine">interfaces utilisateurs</a>, et peut s’interfacer avec d’autres langages comme le <a href="C_(langage)" title="C (langage)">C</a>, <a href="C%2B%2B" title="C++">C++</a>, <a href="Java_(langage)" title="Java (langage)">Java</a>, <a href="Python_(langage)" title="Python (langage)">Python</a> et <a href="Fortran" title="Fortran">Fortran</a>.
</p><p>Les utilisateurs de MATLAB (environ 4 millions en 2019<sup id="cite_ref-mathworks_3-0" class="reference"><a href="#cite_note-mathworks-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>) sont de milieux très différents tels que l’<a href="Ing%C3%A9nierie" title="Ingénierie">ingénierie</a>, les sciences et l’économie, dans un contexte aussi bien industriel que pour la <a href="Recherche_scientifique" title="Recherche scientifique">recherche</a>.
</p><p>MATLAB peut s'utiliser seul ou bien avec des <i>toolboxes</i> (« boîte à outils »).
</p>
<div class="mw-heading mw-heading2"><h2 id="Histoire">Histoire</h2></div>
<p>Le langage MATLAB est conçu par <a href="Cleve_Moler" title="Cleve Moler">Cleve Moler</a> à la fin des années 1970 à partir de deux bibliothèques écrites en <a href="Fortran" title="Fortran">Fortran</a> : <a href="LINPACK" title="LINPACK">LINPACK</a> et <a href="EISPACK" title="EISPACK">EISPACK</a><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>.
</p><p>Alors professeur de mathématiques à l'<a href="Universit%C3%A9_du_Nouveau-Mexique" title="Université du Nouveau-Mexique">université du Nouveau-Mexique</a>, il souhaite permettre à ses étudiants d'utiliser ces deux bibliothèques sans connaître le Fortran. Cleve Moler l'utilise ensuite pour des cours donnés à l'<a href="Universit%C3%A9_Stanford" title="Université Stanford">université Stanford</a> où il reçoit un accueil mitigé de la part des étudiants en mathématiques habitués au Fortran.
</p><p>Les étudiants en <a href="Technologie" title="Technologie">technologie</a>, en particulier en <a href="Traitement_du_signal" title="Traitement du signal">traitement du signal</a>, sont beaucoup plus intéressés. Un ingénieur, Jack Little <a href="https://en.wikipedia.org/wiki/John_N._Little" class="extiw external" title="en:John N. Little"><span class="indicateur-langue" title="Article en anglais : « John N. Little »">(en)</span></a>, en comprend rapidement les capacités et entreprend avec un collègue, Steve Bangert, de le recoder en langage C. En 1984, Jack Little, Cleve Moler et Steve Bangert créent la société The MathWorks afin de commercialiser la version 1.0 de MATLAB<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup><sup class="reference cite_virgule">,</sup><sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>.
</p><p>MATLAB évolue par la suite en intégrant par exemple la bibliothèque <a href="LAPACK" title="LAPACK">LAPACK</a> en 2000<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>, en se dotant de nombreuses boîtes à outils (Toolbox) et en incluant les possibilités données par d'autres <a href="Langage_de_programmation" title="Langage de programmation">langages de programmation</a> comme <a href="C%2B%2B" title="C++">C++</a> ou <a href="Java_(langage)" title="Java (langage)">Java</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Syntaxe">Syntaxe</h2></div>
<p>Le logiciel MATLAB est construit autour du langage MATLAB. Une <a href="Interface_en_ligne_de_commande" title="Interface en ligne de commande">interface en ligne de commande</a>, qui est un des éléments du bureau MATLAB, permet d’exécuter des <a href="Commande_informatique" title="Commande informatique">commandes</a> simples. Des séquences de commandes peuvent être sauvegardées dans un <a href="Fichier_texte" title="Fichier texte">fichier texte</a>, typiquement avec l’<a href="%C3%89diteur_de_code_source" title="Éditeur de code source">éditeur</a> MATLAB, sous la forme d’un « script » ou <a href="Encapsulation_(programmation)" title="Encapsulation (programmation)">encapsulées</a> dans une <a href="Routine_(informatique)" title="Routine (informatique)">fonction</a><sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Variables">Variables</h3></div>
<p>Les variables sont définies avec l’opérateur d’<a href="Affectation_(informatique)" title="Affectation (informatique)">affectation</a> <code>=</code>.
</p><p>MATLAB est un langage à <a href="Type_(informatique)#Typage_fort_et_typage_faible" title="Type (informatique)">typage faible</a>, c'est-à-dire que les <a href="Conversion_de_type" title="Conversion de type">conversions de type</a> sont implicites<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>. Les variables ne sont pas <a href="D%C3%A9claration_(informatique)" title="Déclaration (informatique)">déclarées</a> avec leur <a href="Type_(informatique)" title="Type (informatique)">type</a>, sauf pour les <a href="Objet_(informatique)" title="Objet (informatique)">objets symboliques</a><sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup>, par exemple :
</p>
<div class="mw-highlight mw-highlight-lang-matlab mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">17</span>
<span class="n">x</span><span class="w"> </span><span class="p">=</span>
<span class="w"> </span><span class="mi">17</span>
<span class="o">>></span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">'hat'</span>
<span class="n">x</span><span class="w"> </span><span class="p">=</span>
<span class="n">hat</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Vecteurs/matrices"><span id="Vecteurs.2Fmatrices"></span>Vecteurs/matrices</h3></div>
<p>Comme son nom l’indique, l’intérêt de MATLAB est de pouvoir manipuler facilement des <a href="Vecteur" title="Vecteur">tableaux à une dimension</a> (« vecteur » dans le vocabulaire MATLAB), deux dimensions (« <a href="Matrice_(math%C3%A9matiques)" title="Matrice (mathématiques)">matrices</a> ») ou à multi-dimensions. Par défaut, toutes les variables sont des <a href="Tableau_(structure_de_donn%C3%A9es)" title="Tableau (structure de données)">tableaux</a>, MATLAB permet de faire de la <a href="Vectorisation_(informatique)" title="Vectorisation (informatique)">programmation matricielle</a>. En pratique, les tableaux sont définis de la manière suivante :
</p>
<div class="mw-highlight mw-highlight-lang-matlab mw-content-ltr" dir="ltr"><pre><span></span><span class="o">>></span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="p">[</span><span class="mi">3</span><span class="o">*</span><span class="mi">4</span><span class="p">,</span><span class="w"> </span><span class="nb">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">]</span>
<span class="n">A</span><span class="w"> </span><span class="p">=</span>
<span class="w"> </span><span class="mf">12.0000</span><span class="w"> </span><span class="mf">1.5708</span>
<span class="o">>></span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">3</span><span class="o">*</span><span class="nb">sin</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
<span class="n">B</span><span class="w"> </span><span class="p">=</span>
<span class="w"> </span><span class="o">-</span><span class="mf">1.6097</span><span class="w"> </span><span class="mf">3.0000</span>
<span class="o">>></span><span class="w"> </span><span class="n">C</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">1</span><span class="p">:</span><span class="mi">2</span><span class="p">:</span><span class="mi">9</span>
<span class="n">C</span><span class="w"> </span><span class="p">=</span>
<span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="mi">7</span><span class="w"> </span><span class="mi">9</span>
<span class="o">>></span><span class="w"> </span><span class="n">D</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="p">[</span><span class="mi">16</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="mi">13</span><span class="p">;</span><span class="w"> </span><span class="n">5</span><span class="w"> </span><span class="s">10</span><span class="w"> </span><span class="s">11</span><span class="w"> </span><span class="s">8</span><span class="p">;</span><span class="w"> </span><span class="n">9</span><span class="w"> </span><span class="s">6</span><span class="w"> </span><span class="s">7</span><span class="w"> </span><span class="s">12</span><span class="p">;</span><span class="w"> </span><span class="n">4</span><span class="w"> </span><span class="s">15</span><span class="w"> </span><span class="s">14</span><span class="w"> </span><span class="s">1]</span>
<span class="n">D</span><span class="w"> </span><span class="p">=</span>
<span class="w"> </span><span class="mi">16</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="mi">13</span>
<span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="mi">10</span><span class="w"> </span><span class="mi">11</span><span class="w"> </span><span class="mi">8</span>
<span class="w"> </span><span class="mi">9</span><span class="w"> </span><span class="mi">6</span><span class="w"> </span><span class="mi">7</span><span class="w"> </span><span class="mi">12</span>
<span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="mi">15</span><span class="w"> </span><span class="mi">14</span><span class="w"> </span><span class="mi">1</span>
<span class="o">>></span><span class="w"> </span><span class="n">D</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span>
<span class="nb">ans</span><span class="w"> </span><span class="p">=</span>
<span class="w"> </span><span class="mi">11</span>
</pre></div>
<p>Lorsqu’on définit la variable nommée <code>C</code> (ou lui affecte une nouvelle valeur si celle-ci existe déjà), on crée un tableau contenant les nombres 1, 3, 5, 7 et 9. Ce tableau débute par la valeur initiale 1, incrémenté à chaque valeur par l'incrément 2, et s’arrête avec la valeur finale (ou après avoir dépassé) 9. La variable <code>D</code> est une matrice.
</p><p>L’indexation des tableaux commence à 1<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup>, ce qui est la convention utilisée pour les <a href="Matrice_(math%C3%A9matiques)" title="Matrice (mathématiques)">matrices en mathématiques</a> et par le langage <a href="Fortran" title="Fortran">Fortran</a>, mais est contraire à certains langages de programmation où l’indexation commence à 0 (par exemple <a href="C_(langage)" title="C (langage)">C</a> ou <a href="Python_(langage)" title="Python (langage)">Python</a>).
</p><p>La plupart des fonctions MATLAB acceptent les matrices et s’appliquent à chacun de leurs éléments. Par exemple, <code>mod(2*J,n)</code> multiplie chaque élément de « J » par 2, puis divise chaque élément modulo « n ».
</p><p>Par ailleurs, s’il est possible d’utiliser des <a href="It%C3%A9ration" title="Itération">boucles itératives</a> « <a href="Boucle_for" title="Boucle for">for</a> » ou « <a href="Boucle_while" title="Boucle while">while</a> », il est possible de se servir des notations vectorielles pour les remplacer. Par exemple, le code suivant crée un <a href="Carr%C3%A9_magique_(math%C3%A9matiques)" title="Carré magique (mathématiques)">carré magique</a> de dimension n pour, n <a href="Parit%C3%A9_(arithm%C3%A9tique)" title="Parité (arithmétique)">impair</a><sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-highlight mw-highlight-lang-matlab mw-content-ltr" dir="ltr"><pre><span></span><span class="p">[</span><span class="n">J</span><span class="p">,</span><span class="n">I</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">meshgrid</span><span class="p">(</span><span class="mi">1</span><span class="p">:</span><span class="n">n</span><span class="p">);</span>
<span class="n">A</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">mod</span><span class="p">(</span><span class="n">I</span><span class="o">+</span><span class="n">J</span><span class="o">-</span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span><span class="n">n</span><span class="p">);</span>
<span class="n">B</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">mod</span><span class="p">(</span><span class="n">I</span><span class="o">+</span><span class="mi">2</span><span class="o">*</span><span class="n">J</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span><span class="n">n</span><span class="p">);</span>
<span class="n">M</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">n</span><span class="o">*</span><span class="n">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
</pre></div>
<p>La fonction <code>meshgrid</code> permet de créer des matrices carrées contenant 1:n.
</p>
<div class="mw-heading mw-heading2"><h2 id="Outils_et_modules_associés"><span id="Outils_et_modules_associ.C3.A9s"></span>Outils et modules associés</h2></div>
<p><b>MATLAB</b> est complété par de multiples boîtes à outils<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>. Parmi les plus utilisés, on trouve :
</p>
<div style="column-count:3;margin:.3em 0;" class="colonnes"><div style="margin:-.3em 0;">
<ul><li>Communications Toolbox</li>
<li>Control System Toolbox</li>
<li>Simscape</li>
<li>Image Processing Toolbox<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup></li>
<li>MATLAB Compiler</li>
<li>Deep Learning Toolbox</li>
<li>Optimization Toolbox</li>
<li>Parallel Computing toolbox</li>
<li>Real-Time Workshop, renommé commercialement SimulinkCoder<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup></li>
<li>Robust Control Toolbox</li>
<li>Signal Processing Toolbox</li>
<li>Excel Link</li>
<li><a href="Simulink" title="Simulink">Simulink</a></li>
<li>Statistics and Machine Learning Toolbox</li>
<li>System Identification Toolbox</li>
<li>Predictive Maintenance Toolbox</li>
<li>Stateflow</li></ul>
</div></div>
<div class="mw-heading mw-heading2"><h2 id="Alternatives">Alternatives</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Alternatives_commerciales">Alternatives commerciales</h3></div>
<div style="column-count:3;margin:.3em 0;" class="colonnes"><div style="margin:-.3em 0;">
<ul><li><a href="AMESim" class="mw-redirect" title="AMESim">AMESim</a></li>
<li><a href="GAUSS" title="GAUSS">GAUSS</a></li>
<li><a href="IDL_(langage)" title="IDL (langage)">IDL</a></li>
<li><a href="Traitement_d'images#Bibliothèques_logicielles" title="Traitement d'images">Logiciels de traitement d'image</a> pour Image Processing Toolbox</li>
<li><a href="Maple" title="Maple">Maple</a></li>
<li><a href="Mathcad" title="Mathcad">Mathcad</a></li>
<li><a href="Mathematica" class="mw-redirect" title="Mathematica">Mathematica</a></li>
<li>OxMetrics <a href="https://en.wikipedia.org/wiki/OxMetrics" class="extiw external" title="en:OxMetrics"><span class="indicateur-langue" title="Article en anglais : « OxMetrics »">(en)</span></a></li>
<li><a href="IMSL" class="mw-redirect" title="IMSL">PyIMSL Studio</a></li>
<li><a href="SAS_(langage)" title="SAS (langage)">SAS/IML</a></li>
<li><a href="Stata" title="Stata">Stata</a> (Mata)</li>
<li><a href="Sysquake" title="Sysquake">Sysquake</a></li></ul>
</div></div>
<div class="mw-heading mw-heading3"><h3 id="Alternatives_libres">Alternatives <a href="Logiciel_libre" title="Logiciel libre">libres</a></h3></div>
<div style="column-count:3;margin:.3em 0;" class="colonnes"><div style="margin:-.3em 0;">
<ul><li><a href="FreeMat" title="FreeMat">FreeMat</a></li>
<li><a href="JMathLib" title="JMathLib">JMathLib</a></li>
<li><a href="Traitement_d'images#Bibliothèques_logicielles" title="Traitement d'images">Logiciels de traitement d'image</a> pour Image Processing Toolbox</li>
<li><a href="GNU_Octave" title="GNU Octave">Octave</a></li>
<li><a href="R_(langage)" title="R (langage)">R</a></li>
<li><a href="SageMath" title="SageMath">SageMath</a></li>
<li><a href="Scilab" title="Scilab">Scilab</a></li>
<li><a href="SciPy" title="SciPy">SciPy</a></li></ul>
</div></div>
<div class="mw-heading mw-heading2"><h2 id="Références"><span id="R.C3.A9f.C3.A9rences"></span>Références</h2></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-wikidata-d2101fd1416246a9233dcd29e3deb706f0668d14-1"><span class="mw-cite-backlink"><a href="#cite_ref-wikidata-d2101fd1416246a9233dcd29e3deb706f0668d14_1-0">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="https://www.mathworks.com/videos/r2025b-release-highlights-1757449057407.html"><cite style="font-style:normal;">https://www.mathworks.com/videos/r2025b-release-highlights-1757449057407.html</cite></a> »</span></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="https://stackoverflow.com/questions/17253545/scripting-language-vs-programming-language"><cite style="font-style:normal;">Scripting Language vs Programming Language</cite></a> », sur <span class="italique">Stack Overflow</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2019-08-31" data-sort-value="2019-08-31">31 août 2019</time>)</small></span></span>
</li>
<li id="cite_note-mathworks-3"><span class="mw-cite-backlink"><a href="#cite_ref-mathworks_3-0">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="https://fr.mathworks.com/company/aboutus.html"><cite style="font-style:normal;">La société</cite></a> », sur <span class="italique">mathworks.com</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2023-11-14" data-sort-value="2023-11-14">14 novembre 2023</time>)</small></span>.</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a> </span><span class="reference-text">Cleve B. Moler, <i>Design of an interactive matrix calculator</i>, AFIPS '80 Proceedings of the May 19-22, 1980, national computer conference <small class=" noarchive"><a href="Digital_Object_Identifier" title="Digital Object Identifier">DOI</a> <a rel="nofollow" class="external text" href="https://dx.doi.org/10.1145%2F1500518.1500576">10.1145/1500518.1500576</a></small></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><a href="#cite_ref-5">↑</a> </span><span class="reference-text"><span class="ouvrage" id="Moler"><span class="ouvrage" id="Cleve_Moler"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> Cleve Moler, « <a rel="nofollow" class="external text" href="https://www.mathworks.com/company/newsletters/news_notes/clevescorner/dec04.html"><cite style="font-style:normal;" lang="en">The Origins of MATLAB</cite></a> »</span></span></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><a href="#cite_ref-6">↑</a> </span><span class="reference-text"><a rel="nofollow" class="external text" href="ftp://ftp.funet.fi/pub/sci/math/misc/programs/matlab/">Code source</a> de la première version de MATLAB (écrite en Fortran), sur le site FTP du FUNET</span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><a href="#cite_ref-7">↑</a> </span><span class="reference-text"><span class="ouvrage" id="Moler"><span class="ouvrage" id="Cleve_Moler"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> Cleve Moler, « <a rel="nofollow" class="external text" href="https://www.mathworks.com/company/newsletters/news_notes/clevescorner/winter2000.cleve.html"><cite style="font-style:normal;" lang="en">MATLAB Incorporates LAPACK</cite></a> »</span></span></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><a href="#cite_ref-8">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> « <a rel="nofollow" class="external text" href="https://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html"><cite style="font-style:normal;" lang="en">MATLAB technical documentation</cite></a> », Mathworks.com <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2010-06-07" data-sort-value="2010-06-07">7 juin 2010</time>)</small></span></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><a href="#cite_ref-9">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="https://fr.mathworks.com/help/matlab/matlab_oop/matlab-vs-other-oo-languages.html"><cite style="font-style:normal;">Comparison of MATLAB and Other OO Languages</cite></a> »</span></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><a href="#cite_ref-10">↑</a> </span><span class="reference-text"><a rel="nofollow" class="external text" href="https://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/f0-49321.html#brbg3pf">sym function</a>, Documentation for the MATLAB Symbolic Toolbox.</span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><a href="#cite_ref-11">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> « <a rel="nofollow" class="external text" href="https://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-85462.html"><cite style="font-style:normal;" lang="en">MATLAB Online Documentation</cite></a> », Mathworks.com <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2010-06-07" data-sort-value="2010-06-07">7 juin 2010</time>)</small></span>.</span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><a href="#cite_ref-12">↑</a> </span><span class="reference-text"><a rel="nofollow" class="external text" href="https://www.mathworks.fr/moler/exm/chapters.html">Experiments with MATLAB, Cleve Moler</a> (chap. 10 - Magic Squares).</span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><a href="#cite_ref-13">↑</a> </span><span class="reference-text"><a rel="nofollow" class="external text" href="https://www.mathworks.com/products.html">Liste des produits de MathWorks</a></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><a href="#cite_ref-14">↑</a> </span><span class="reference-text"><span class="ouvrage" id="Léonard2003"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> Léonard <i><abbr class="abbr" title="et alii (et d’autres)">et al.</abbr></i>, « <cite style="font-style:normal" lang="en">Image analysis of X-ray microtomograms of soft materials during convective drying</cite> », <i><span class="lang-en" lang="en">Journal of Microscopy</span></i>, <abbr class="abbr" title="volume">vol.</abbr> 2, <time class="nowrap" datetime="2003-11-12" data-sort-value="2003-11-12">12 novembre 2003</time>, <abbr class="abbr" title="pages">p.</abbr> <span class="nowrap">197-204</span> <small style="line-height:1em;">(<a href="Digital_Object_Identifier" title="Digital Object Identifier">DOI</a> <span class=" noarchive nowrap"><a rel="nofollow" class="external text" href="https://dx.doi.org/10.1046/j.1365-2818.2003.01242.x">10.1046/j.1365-2818.2003.01242.x</a></span>)</small><span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=Image+analysis+of+X-ray+microtomograms+of+soft+materials+during+convective+drying&rft.jtitle=Journal+of+Microscopy&rft.au=L%C3%A9onard&rft.date=2003-11-12&rft.volume=2&rft.pages=197-204&rft_id=info%3Adoi%2F10.1046%2Fj.1365-2818.2003.01242.x&rfr_id=info%3Asid%2Ffr.wikipedia.org%3AMATLAB"></span></span><span class="citation">« Algorithms were developed using Matlab software and the image analysis toolbox version 6.0 from Matworks. »</span></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><a href="#cite_ref-15">↑</a> </span><span class="reference-text"><a rel="nofollow" class="external free" href="https://www.mathworks.com/products/simulink-coder">https://www.mathworks.com/products/simulink-coder</a> Simulink Coder</span>
</li>
</ol></div>
</div>
<div class="mw-heading mw-heading2"><h2 id="Voir_aussi">Voir aussi</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Bibliographie">Bibliographie</h3></div>
<ul><li>Adrian Biran et Moshe Breiner, <i>MATLAB pour l'ingénieur : Versions 6 et 7</i>, Pearson Education, 2004 <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">2744070254</span>)</small></li>
<li>Jean-Thierry Lapresté, <i>Introduction à MATLAB</i>, Ellipses, 2005 <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">2729824014</span>)</small></li></ul>
<div class="mw-heading mw-heading3"><h3 id="Liens_externes">Liens externes</h3></div>
<p class="mw-empty-elt">
</p>
<ul><li><cite class="ouvrage" id="site_officiel" style="font-style: normal;">Sites officiels : <span class="wd_p856"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> <a rel="nofollow" class="external text" href="https://www.mathworks.com/products/matlab.html">www.mathworks.com/products/matlab.html</a> et <abbr class="abbr indicateur-langue" title="Langue : allemand">(de)</abbr> <a rel="nofollow" class="external text" href="https://de.mathworks.com/products/matlab.html">de.mathworks.com/products/matlab.html</a></span></cite></li>
<li class="mw-empty-elt"></li>
<li><div class="liste-horizontale"><span class="wd_identifiers">Notices dans des dictionnaires ou encyclopédies généralistes</span> : <ul><li><a rel="nofollow" class="external text" href="https://www.britannica.com/topic/MATLAB"><i>Britannica</i></a></li> <li><a rel="nofollow" class="external text" href="https://snl.no/MATLAB"><i>Store norske leksikon</i></a></li> </ul></div></li>
<li><div class="liste-horizontale"><span class="wd_identifiers"><a href="Autorit%C3%A9_(sciences_de_l'information)" title="Autorité (sciences de l'information)">Notices d'autorité</a></span> : <ul><li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="http://viaf.org/viaf/178697808">VIAF</a></span></li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="https://catalogue.bnf.fr/ark:/12148/cb12488192g">BnF</a></span> (<span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="https://data.bnf.fr/ark:/12148/cb12488192g">données</a></span>)</li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="http://www.idref.fr/03409038X">IdRef</a></span></li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="http://id.loc.gov/authorities/n92036881">LCCN</a></span></li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="https://www.nli.org.il/en/authorities/987007289707705171">Israël</a></span></li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="https://cantic.bnc.cat/registre/981060555939706706">Catalogne</a></span></li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="https://authority.bibsys.no/authority/rest/authorities/html/90605893">Norvège</a></span></li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="https://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica=ph117047">Tchéquie</a></span></li> <li><span class="nowrap uid noarchive"><a rel="nofollow" class="external text" href="https://catalogue.nlg.gr/Authority/Record?id=au.59208">Grèce</a></span></li> </ul></div></li></ul>
<div class="navbox-container" style="clear:both;">
</div>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail des logiciels</span> </span></li> </ul></div><!--htdig_noindex--><div><div class="zim-footer">
Cet article est issu de <a class="external text" title="Dernière modification le 2025-05-29" href="https://fr.wikipedia.org/wiki/?title=MATLAB&oldid=226089563">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>
</body></html>